package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.UserResourcesMapper;
import com.education.wisdom.pojo.UserResources;
import com.education.wisdom.service.IUserResourcesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 用户上传资源 服务层实现
 *
 * @author ruoyi
 * @date 2019-01-24
 */
@Service
public class UserResourcesServiceImpl implements IUserResourcesService {
    @Autowired
    private UserResourcesMapper userResourcesMapper;

    /**
     * 查询用户上传资源信息
     *
     * @param id 用户上传资源ID
     * @return 用户上传资源信息
     */
    @Override
    public UserResources selectUserResourcesById(Integer id) {
        return userResourcesMapper.selectUserResourcesById(id);
    }

    /**
     * 查询用户上传资源列表
     *
     * @param userResources 用户上传资源信息
     * @return 用户上传资源集合
     */
    @Override
    public List<UserResources> selectUserResourcesList(UserResources userResources) {
        return userResourcesMapper.selectUserResourcesList(userResources);
    }

    @Override
    public List<UserResources> selectUserResourcessix(UserResources userResources) {
        return userResourcesMapper.selectUserResourcessix(userResources);
    }

    /**
     * 新增用户上传资源
     *
     * @param userResources 用户上传资源信息
     * @return 结果
     */
    @Override
    public int insertUserResources(UserResources userResources) {
        return userResourcesMapper.insertUserResources(userResources);
    }

    /**
     * 修改用户上传资源
     *
     * @param userResources 用户上传资源信息
     * @return 结果
     */
    @Override
    public int updateUserResources(UserResources userResources) {
        return userResourcesMapper.updateUserResources(userResources);
    }

    /**
     * 删除用户上传资源对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteUserResourcesByIds(String ids) {
        return userResourcesMapper.deleteUserResourcesByIds(Convert.toStrArray(ids));
    }

    @Override
    public List<UserResources> selectFreeList() {
        return userResourcesMapper.selectFreeList();
    }

    @Override
    public List<UserResources> selectNewList() {
        return userResourcesMapper.selectNewList();
    }

    @Override
    public List<UserResources> selectPubicList(Map<String, Object> map) {
        return userResourcesMapper.selectPubicList(map);
    }

    @Override
    public int selectCount(Map<String, Object> map) {
        return userResourcesMapper.selectCount(map);
    }

    @Override
    public List<UserResources> selectDownloadList(Map<String, Object> map) {
        return userResourcesMapper.selectDownloadList(map);
    }

    @Override
    public List<UserResources> selectByStatus(Map<String, Object> map) {
        return userResourcesMapper.selectByStatus(map);
    }

    @Override
    public List<UserResources> selectResourcesList(Map<String, Object> map) {
        return userResourcesMapper.selectResourcesList(map);
    }
}
